I am new to Dapper. I am using Dapper in my repository class to get an object. Here is the code:
private static readonly string SELECT_BY_ =
@"
select
DI.Id,
DI.Title as DelegateTitle,
DI.FirstName as DelegateFirstName,
DI.Surname as DelegateSurname,
DI.ActivationEmail as DelegateEmail
from
PreDelegateUserInvitations as DI
WHERE DI.[Id] = @DelInvitationId";
public async Task<InvitationModel> GetInvitationDetails(Guid invitation)
{
var sql = new StringBuilder(SELECT_BY_);
if (invitation == null || invitation == Guid.Empty)
return null;
string sqlCmd = sql.ToString();
var result = await Connection.QueryFirstOrDefaultAsync<InvitationModel>(sqlCmd,
new
{
DelInvitationId = invitation
});
return result;
}
When I try to execute this repository from my API with Postman request it continues to work but no error message shows. I waited a very long time to complete this but it does not show me any error message. Can anyone help me to solve the problem?
Note that, I am using SQL Server and Field type of the Id property is uniqueidentifier