Пример #1
0
        public async Task <Project> GetByIdProject(int id)
        {
            try
            {
                Project project = await Db.Set <Project>()
                                  .AsNoTracking()
                                  .FirstOrDefaultAsync(x => x.Id == id);

                return(project);
            }
            catch (Exception ex)
            {
                throw new Exception("Error: ", ex);
            }
        }
Пример #2
0
 public async Task <List <Course> > GetAllCourses()
 {
     return(await Db.Set <Course>()
            .AsNoTracking()
            .ToListAsync());
 }