예제 #1
0
        public async Task <CategoryUpdateModel> Get(string id)
        {
            if (!_isAuthorized || !await _repositoryCategory.Any(x => x.Id == id && x.State == MRApiCommon.Infrastructure.Enum.MREntityState.Active))
            {
                throw _eNotFound <CategoryUpdateModel>("Category not found");
            }

            return(_mapper.Map <CategoryUpdateModel>(await _repositoryCategory.GetFirst(x => x.Id == id && x.State == MRApiCommon.Infrastructure.Enum.MREntityState.Active)));
        }