예제 #1
0
        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
                    });
                }
            }
        }
예제 #2
0
        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>()
                        {
                        }
                    });
                }
            }
        }
예제 #3
0
        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
                        }
                    });
                }
            }
        }