コード例 #1
0
ファイル: BaseService.cs プロジェクト: Tommmciu/MyJersey
        public int Delete(int id)
        {
            var entity = _context.Set <T>().FirstOrDefault(x => x.Id == id);

            if (entity is null)
            {
                throw new ArgumentException($"Can not find entity with id: {id}.", nameof(id));
            }
            return(Delete(entity));
        }
コード例 #2
0
ファイル: JerseyService.cs プロジェクト: Tommmciu/MyJersey
 public IEnumerable <Jersey> GetView()
 {
     return(_context.Set <Jersey>().Include(x => x.Photos).Include(x => x.Team));
 }