public ServiceResponse <HeadstoneUserRole> Find(Expression <Func <HeadstoneUserRole, bool> > predicate) { using (var bo = new UserRoleDAO()) { HeadstoneUserRole result = bo.Find(predicate) as HeadstoneUserRole; if (result != null) { return(new ServiceResponse <HeadstoneUserRole>() { Type = ServiceResponseTypes.Success, Source = ServiceResponseSources.MsSQL, Result = new List <HeadstoneUserRole>() { result } }); } else { return(new ServiceResponse <HeadstoneUserRole>() { Type = ServiceResponseTypes.Error, Source = ServiceResponseSources.MsSQL }); } } }
public ServiceResponse <HeadstoneUserRole> FindIncluding(Expression <Func <HeadstoneUserRole, bool> > predicate, params object[] includes) { using (var bo = new UserRoleDAO()) { var result = bo.Find(predicate, includes); if (result != null) { return(new ServiceResponse <HeadstoneUserRole>() { Type = ServiceResponseTypes.Success, Source = ServiceResponseSources.MsSQL, Result = new List <HeadstoneUserRole>() { result } }); } else { return(new ServiceResponse <HeadstoneUserRole>() { Type = ServiceResponseTypes.Error, Source = ServiceResponseSources.MsSQL, Result = new List <HeadstoneUserRole>() { } }); } } }
public ServiceResponse <HeadstoneUserRole> Delete(Expression <Func <HeadstoneUserRole, bool> > predicate) { using (var bo = new UserRoleDAO()) { var model = bo.Find(predicate); bool isDeleted = bo.Delete(model as HeadstoneUserRole, true); if (isDeleted) { return(new ServiceResponse <HeadstoneUserRole>() { Type = ServiceResponseTypes.Success, Source = ServiceResponseSources.MsSQL, Result = new List <HeadstoneUserRole>() { model } }); } else { return(new ServiceResponse <HeadstoneUserRole>() { Type = ServiceResponseTypes.Error, Source = ServiceResponseSources.MsSQL, Result = new List <HeadstoneUserRole>() { model } }); } } }