mirror of
https://github.com/claunia/marechai.git
synced 2025-12-16 19:14:25 +00:00
Add document person creation in admin view.
This commit is contained in:
@@ -47,6 +47,20 @@ namespace Marechai.Services
|
||||
await _context.SaveChangesAsync();
|
||||
}
|
||||
|
||||
public async Task<int> CreateAsync(DocumentPersonViewModel viewModel)
|
||||
{
|
||||
var model = new DocumentPerson
|
||||
{
|
||||
Alias = viewModel.Alias, Name = viewModel.Name, Surname = viewModel.Surname,
|
||||
DisplayName = viewModel.DisplayName, PersonId = viewModel.PersonId
|
||||
};
|
||||
|
||||
await _context.AddAsync(model);
|
||||
await _context.SaveChangesAsync();
|
||||
|
||||
return model.Id;
|
||||
}
|
||||
|
||||
public async Task DeleteAsync(int id)
|
||||
{
|
||||
DocumentPerson item = await _context.DocumentPeople.FindAsync(id);
|
||||
|
||||
Reference in New Issue
Block a user