コード例 #1
0
ファイル: ProductService.cs プロジェクト: ayshilal/AllForKids
        public ServicePrimitiveResponseObject <ProductDtoEditModel> GetById(long id)
        {
            var result = new ServicePrimitiveResponseObject <ProductDtoEditModel>();
            var data   = FindFirstBy(p => p.ID == id);

            if (data != null)
            {
                var product = new ProductDtoEditModel();
                product.Id           = data.ID;
                product.Name         = data.Name;
                product.InsertUserId = data.InsertUserId;
                product.InsertDate   = data.InsertDate;
                product.Status       = data.Status;

                result.Data = product;
            }
            return(result);
        }
コード例 #2
0
        public ServicePrimitiveResponseObject <CategoryDtoEditModel> GetById(long id)
        {
            var result = new ServicePrimitiveResponseObject <CategoryDtoEditModel>();
            var data   = FindFirstBy(p => p.ID == id);

            if (data != null)
            {
                var category = new CategoryDtoEditModel();
                category.ID           = data.ID;
                category.Slug         = data.Slug;
                category.Type         = data.Image;
                category.InsertUserId = data.InsertUserId;
                category.InsertDate   = data.InsertDate;
                category.Status       = data.Status;

                result.Data = category;
            }
            return(result);
        }