public IEnumerable <UserIdentity> GetAll() { using (var connection = context.CreateConnection()) { return(connection.Query <UserIdentity>(UserIdentityQuery.All())); } }
public UserIdentity GetById(Guid id) { using (var connection = context.CreateConnection()) { return(connection.Query <UserIdentity>(UserIdentityQuery.ById(id)).SingleOrDefault()); } }
public void Delete(Guid id) { using (var connection = context.CreateConnection()) { connection.Execute(UserIdentityQuery.Delete(id)); } }
public UserIdentity Update(UserIdentity user) { using (var connection = context.CreateConnection()) { connection.Execute(UserIdentityQuery.Update(user)); return(user); } }
public UserIdentity Create(UserIdentity user) { if (user.Id == Guid.Empty) { user.Id = Guid.NewGuid(); } using (var connection = context.CreateConnection()) { connection.Execute(UserIdentityQuery.Insert(user)); return(user); } }