abe545 / CodeOnlyStoredProcedures

A library for easily calling Stored Procedures in .NET using only code (no xml or gui).
MIT License
4 stars 3 forks source link

Dynamic Syntax should allow TVPs without the TableValuedParameterAttribute #29

Closed abe545 closed 9 years ago

abe545 commented 9 years ago

But not anonymous types. So, this should still throw, but with a more descriptive exception:

public void ExecuteTakesTVP(IEnumerable<string> args)
{
    connection.Execcute().usp_TakesTVP(args.Select(s => new { Name = s });
}

But this should pass NamedType as the table name, and dbo as the schema:

public class NamedType
{
    public string Name { get; set; } 
}

public void ExecuteTakesTVP(IEnumerable<string> args)
{
    connection.Execcute().usp_TakesTVP(args.Select(s => new NamedType { Name = s });
}