as no tracking get methods
This commit is contained in:
parent
0ee41aebef
commit
8790e7c7cf
6 changed files with 27 additions and 1 deletions
|
|
@ -19,6 +19,11 @@ public class AnswerRepository : IAnswerRepository
|
|||
throw new NotImplementedException();
|
||||
}
|
||||
|
||||
public async Task<Answer?> GetByIdAsNoTrackingAsync(int id)
|
||||
{
|
||||
throw new NotImplementedException();
|
||||
}
|
||||
|
||||
public async Task<IEnumerable<Answer>> GetAllAsync()
|
||||
{
|
||||
return await _context.Answers.ToListAsync();
|
||||
|
|
|
|||
|
|
@ -19,6 +19,11 @@ public class AnswerVariantsRepository : IAnswerVariantsRepository
|
|||
return await _context.AnswerVariants.FindAsync(id);
|
||||
}
|
||||
|
||||
public async Task<AnswerVariant?> GetByIdAsNoTrackingAsync(int id)
|
||||
{
|
||||
return await _context.AnswerVariants.AsNoTracking().FirstOrDefaultAsync(x => x.Id == id);
|
||||
}
|
||||
|
||||
public async Task<IEnumerable<AnswerVariant>> GetAllAsync()
|
||||
{
|
||||
return await _context.AnswerVariants.ToListAsync();
|
||||
|
|
|
|||
|
|
@ -19,6 +19,11 @@ public class CompletionRepository : ICompletionRepository
|
|||
return await _context.Completions.Include(c => c.Answers).FirstOrDefaultAsync(c => c.Id == id);
|
||||
}
|
||||
|
||||
public async Task<Completion?> GetByIdAsNoTrackingAsync(int id)
|
||||
{
|
||||
return await _context.Completions.AsNoTracking().FirstOrDefaultAsync(c => c.Id == id);
|
||||
}
|
||||
|
||||
public async Task<IEnumerable<Completion>> GetAllAsync()
|
||||
{
|
||||
return await _context.Completions.ToListAsync();
|
||||
|
|
|
|||
|
|
@ -19,6 +19,11 @@ public class QuestionRepository : IQuestionRepository
|
|||
return await _context.Questions.FindAsync(id);
|
||||
}
|
||||
|
||||
public async Task<QuestionBase?> GetByIdAsNoTrackingAsync(int id)
|
||||
{
|
||||
return await _context.Questions.AsNoTracking().FirstOrDefaultAsync(x => x.Id == id);
|
||||
}
|
||||
|
||||
public async Task<IEnumerable<QuestionBase>> GetAllAsync()
|
||||
{
|
||||
return await _context.Questions.ToListAsync();
|
||||
|
|
|
|||
|
|
@ -19,6 +19,11 @@ public class SurveyRepository : ISurveyRepository
|
|||
return await _context.Surveys.FindAsync(id);
|
||||
}
|
||||
|
||||
public async Task<Survey?> GetByIdAsNoTrackingAsync(int id)
|
||||
{
|
||||
return await _context.Surveys.AsNoTracking().FirstOrDefaultAsync(c => c.Id == id);
|
||||
}
|
||||
|
||||
public async Task<IEnumerable<Survey>> GetAllAsync()
|
||||
{
|
||||
return await _context.Surveys.ToListAsync();
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue