public void Insert(GroupIdentityEntity group, IConnectionFactory connectionFactory) { try { using (var connection = connectionFactory.Create()) { connection.Execute(SqlCommandStorageService.GroupIdentityInsert(), new { name = group.Name }); } } catch (Exception exception) { DemLogger.Current.Error(exception, $"{nameof(GroupIdentityRepository)}. Error in function {DemLogger.GetCallerInfo()}"); } }
public GroupIdentityEntity GetGroupByName(string groupName, IConnectionFactory connectionFactory) { GroupIdentityEntity groupIdentityEntity = new GroupIdentityEntity(); try { using (var connection = connectionFactory.Create()) { groupIdentityEntity = connection.Query <GroupIdentityEntity>(SqlCommandStorageService.GroupIdentityGetGroupByName(), new { nane = groupName }).SingleOrDefault(); } } catch (Exception exception) { DemLogger.Current.Error(exception, $"{nameof(GroupIdentityRepository)}. Error in function {DemLogger.GetCallerInfo()}"); } return(groupIdentityEntity); }