Example #1
0
        public async Task <SubCategoryDomainModel> GetSubCategoryById(int id)
        {
            SubCategoryDomainModel subCategory = new SubCategoryDomainModel();
            var model = await subCategoryRepository.SingleOrDefault(s => s.subCat_id == id);

            if (model != null)
            {
                subCategory           = new SubCategoryDomainModel();
                subCategory.subCat_id = model.subCat_id;
                subCategory.name      = model.name;
                subCategory.cat_id    = model.cat_id;
            }
            return(subCategory);
        }