598 lines
24 KiB
C#
598 lines
24 KiB
C#
using System;
|
|
using System.Collections.Generic;
|
|
using System.Linq;
|
|
using System.Text;
|
|
using System.Threading.Tasks;
|
|
using AyCode.Models.Enums;
|
|
using Microsoft.EntityFrameworkCore;
|
|
using TIAM.Database.DbContexts;
|
|
using TIAM.Entities.Permissions;
|
|
using TIAM.Entities.Products;
|
|
using TIAM.Entities.ServiceProviders;
|
|
using TIAM.Entities.Products.DTOs;
|
|
using TIAM.Entities.Users;
|
|
|
|
|
|
namespace TIAM.Database.DataLayers.ServiceProviders
|
|
{
|
|
public class ServiceProviderDal : TiamDalBase<ServiceProviderDbContext>
|
|
{
|
|
|
|
public ServiceProviderDal() : base()
|
|
{
|
|
}
|
|
|
|
public ServiceProviderDal(ServiceProviderDbContext _object)
|
|
{
|
|
}
|
|
|
|
#region ServiceProviders
|
|
|
|
//16. (IServiceProviderDataService) get all service providers
|
|
public Task<List<TiamServiceProvider>> GetServiceProvidersAsync()
|
|
{
|
|
return Context.ServiceProviders.ToListAsync();
|
|
}
|
|
|
|
//18. (IServiceProviderDataService) get serviceProvider by Id
|
|
public virtual Task<TiamServiceProvider?> GetServiceProviderByIdAsync(Guid id)
|
|
{
|
|
Console.WriteLine($"Getting serviceProvider from db {id}");
|
|
return Context.ServiceProviders.SingleOrDefaultAsync(x=>x.Id == id);
|
|
}
|
|
|
|
//15. (IServiceProviderDataService) Create service provider
|
|
public Task<bool> CreateServiceProviderAsync(TiamServiceProvider serviceProvider)
|
|
{
|
|
if(serviceProvider.Name == Context.ServiceProviders.FirstOrDefault(x=>x.Name == serviceProvider.Name)?.Name)
|
|
{
|
|
throw new Exception("ServiceProvider already exists");
|
|
}
|
|
else
|
|
{
|
|
|
|
Context.ServiceProviders.Add(serviceProvider);
|
|
Console.WriteLine($"Saving serviceProvider to db {serviceProvider.Id}, {serviceProvider.Name}, {serviceProvider.OwnerId}");
|
|
return Context.SaveChangesAsync().ContinueWith(x=>x.Result > 0);
|
|
|
|
}
|
|
}
|
|
|
|
//14. (IserviceProviderDataService) Update service provider
|
|
public Task<bool> UpdateServiceProviderAsync(TiamServiceProvider serviceProvider)
|
|
{
|
|
var dbServiceProvider = Context.ServiceProviders.FirstOrDefault(u => u.Id == serviceProvider.Id);
|
|
if (dbServiceProvider != null)
|
|
{
|
|
dbServiceProvider = serviceProvider;
|
|
Context.ServiceProviders.Update(dbServiceProvider);
|
|
return Context.SaveChangesAsync().ContinueWith(x => x.Result > 0);
|
|
}
|
|
else
|
|
{
|
|
throw new Exception("ServiceProvider not found");
|
|
}
|
|
}
|
|
|
|
//13. (IserviceProviderDataService) delete service provider
|
|
public Task<bool> DeleteServiceProviderAsync(Guid id)
|
|
{
|
|
using (var transaction = Context.Database.BeginTransaction())
|
|
{
|
|
var dbServiceProvider = Context.ServiceProviders.FirstOrDefault(u => u.Id == id);
|
|
if (dbServiceProvider != null)
|
|
{
|
|
//get products for this provider
|
|
var products = Context.Products.Where(x => x.OwnerId == id).ToList();
|
|
|
|
/*foreach (var productItem in products)
|
|
{
|
|
//delete products
|
|
var permissionContextMappings = Context.PermissionContextMappings.Where(x => x.ContextId == productItem.Id).ToList();
|
|
//iterate through every row
|
|
foreach (var item in permissionContextMappings)
|
|
{
|
|
|
|
if (item.SubjectType == (int)PermissionContextMappingSubjectType.Group)
|
|
{
|
|
//get users in the permissiongroup
|
|
var permissionGroupUserMapping = Context.PermissionGroupUserMappings.Where(x => x.PermissionContextMappingId == item.Id).ToList();
|
|
//remove every row (users) from permissiongroup
|
|
foreach (var user in permissionGroupUserMapping)
|
|
{
|
|
Context.PermissionGroupUserMappings.Remove(user);
|
|
}
|
|
}
|
|
}
|
|
//remove permissioncontextmappings
|
|
Context.PermissionContextMappings.RemoveRange(permissionContextMappings);
|
|
}*/
|
|
Context.Products.RemoveRange(products);
|
|
Context.ServiceProviders.Remove(dbServiceProvider);
|
|
return Context.SaveChangesAsync().ContinueWith(x => x.Result > 0);
|
|
}
|
|
else
|
|
{
|
|
return Task.FromResult(false);
|
|
}
|
|
}
|
|
}
|
|
|
|
//17. (IServiceProviderDataService) get service provider by ownerId
|
|
public Task<List<TiamServiceProvider>> GetServiceProvidersByOwnerIdAsync()
|
|
{
|
|
throw new NotImplementedException();
|
|
|
|
}
|
|
|
|
#endregion
|
|
|
|
#region PermissionTypes
|
|
|
|
|
|
//10. (IPermissionService) create permission type
|
|
public Task<bool> CreatePermissionsTypeAsync(PermissionsType permissionsType)
|
|
{
|
|
bool result = false;
|
|
|
|
using (var transaction = Context.Database.BeginTransaction())
|
|
{
|
|
var existingPermission = Context.PermissionsTypes
|
|
.FirstOrDefault(x => x.PermissionName == permissionsType.PermissionName)?.PermissionName;
|
|
|
|
if (existingPermission == null)
|
|
{
|
|
//get all the permissiontypes for this context
|
|
var permissionTypes = new List<PermissionsType>();
|
|
var nextBitValue = 0.0;
|
|
permissionTypes = Context.PermissionsTypes
|
|
.Where(x => x.ContextId == permissionsType.ContextId)
|
|
.ToList();
|
|
|
|
//get the max value of the permissiontypes
|
|
if (permissionTypes != null)
|
|
{
|
|
//next bit value is the power of two of the count of the permissiontypes
|
|
nextBitValue = Math.Pow(2, permissionTypes.Count);
|
|
}
|
|
else
|
|
{
|
|
nextBitValue = Math.Pow(2,0);
|
|
}
|
|
permissionsType.PermissionBit = (int)nextBitValue;
|
|
Context.PermissionsTypes.Add(permissionsType);
|
|
Context.SaveChanges();
|
|
transaction.Commit();
|
|
result = true;
|
|
}
|
|
else
|
|
{
|
|
result = false;
|
|
}
|
|
|
|
}
|
|
return Task.FromResult(result);
|
|
|
|
}
|
|
|
|
//11. (IPermissionService) get permission types for context
|
|
public Task<List<PermissionsType>>? GetPermissionTypesByContextIdAsync(Guid contextId)
|
|
{
|
|
return Context.PermissionsTypes.Where(x => x.ContextId == contextId).ToListAsync();
|
|
}
|
|
|
|
public Task<int> GetPermissionFromPermissionType(PermissionsType pType)
|
|
{
|
|
if(Context.PermissionsTypes.FirstOrDefault(x=>x.Id == pType.Id) != null)
|
|
{
|
|
return Task.FromResult(pType.PermissionBit);
|
|
}
|
|
else
|
|
{
|
|
return Task.FromResult(0);
|
|
}
|
|
}
|
|
|
|
#endregion
|
|
|
|
#region PermissionMappings
|
|
|
|
public Task<List<PermissionContextMapping>> GetPermissionContextMappingByContextIdAsync(Guid contextId)
|
|
=> SessionAsync(x => x.GetPermissionContextMappingByContextId(contextId).ToList());
|
|
|
|
//2. get the contexts where the user has permission
|
|
//public async Task<List<AssignedPermissionModel>> GetPermissionModelByUserIdAsync(Guid UserId)
|
|
//{
|
|
// List<AssignedPermissionModel> _permissions = new List<AssignedPermissionModel>();
|
|
// //get all assignedUsers
|
|
// List<AssignedUser> assignedUsers = await Context.AssignedUsers.Where(x => x.EmployeeUserId == UserId).ToListAsync();
|
|
// //List<PermissionContextMapping> _permissionContextMappings = new List<PermissionContextMapping>();
|
|
// List<PermissionGroupUserMapping> _permissionGroupUserMappings = new List<PermissionGroupUserMapping>();
|
|
// //get contexts where the user has permission
|
|
// foreach (var item in assignedUsers)
|
|
// {
|
|
// //get the product where the permissioncontextmapping is
|
|
// var contextMapping = await Context.PermissionContextMappings.FirstOrDefaultAsync(x => x.SubjectId == item.Id);
|
|
// if (contextMapping != null)
|
|
// {
|
|
// _permissions.Add(new AssignedPermissionModel(item.ContextId, item.Id, PermissionContextMappingSubjectType.User, item.Id.ToString(), contextMapping.Permissions));
|
|
// }
|
|
// //get permissiongroupusermappings where the user is in the group
|
|
// _permissionGroupUserMappings = await Context.PermissionGroupUserMappings.Where(x => x.AssignedUserId == item.Id).ToListAsync();
|
|
|
|
// foreach (var groupUserMapping in _permissionGroupUserMappings)
|
|
// {
|
|
// //get the permissioncontextmapping where the permissiongroup is
|
|
// var contextMapping2 = await Context.PermissionContextMappings.FirstOrDefaultAsync(x => x.Id == groupUserMapping.PermissionContextMappingId);
|
|
// if (contextMapping2 != null)
|
|
// {
|
|
|
|
// //get the group so we have the contextId
|
|
// var group = await Context.PermissionGroups.FirstOrDefaultAsync(x => x.Id == contextMapping2.SubjectId);
|
|
|
|
// _permissions.Add(new AssignedPermissionModel(group.ContextId, contextMapping2.SubjectId, PermissionContextMappingSubjectType.Group, group.GroupName, contextMapping2.Permissions));
|
|
// }
|
|
// }
|
|
|
|
// }
|
|
|
|
// return _permissions;
|
|
//}
|
|
|
|
//3. (IPermissionService) get permissions of assigned users and groups
|
|
public Task<List<AssignedPermissionModel>> GetPermissionsOfAssignedUsersAndGroupsAsyncByContextId(Guid contextId)
|
|
{
|
|
List<AssignedPermissionModel> result = new List<AssignedPermissionModel>();
|
|
|
|
var AssignedUsers = Context.AssignedUsers.Where(x => x.ContextId == contextId).ToListAsync();
|
|
|
|
if (AssignedUsers.Result != null)
|
|
{
|
|
foreach (var item in AssignedUsers.Result)
|
|
{
|
|
var mappingRow = Context.PermissionContextMappings.Where(x => x.SubjectId == item.Id).ToListAsync();
|
|
if (mappingRow.Result == null)
|
|
{
|
|
//user has no permission but is assigned... must be banned
|
|
|
|
}
|
|
else if (mappingRow.Result.Count > 1)
|
|
{
|
|
//user has been assigned more than onece to same context
|
|
|
|
}
|
|
else
|
|
{
|
|
foreach (var mapping in mappingRow.Result)
|
|
{
|
|
result.Add(new AssignedPermissionModel(item.ContextId, item.Id, mapping.SubjectType, item.EmployeeUserId.ToString(), mapping.Permissions));
|
|
}
|
|
}
|
|
|
|
}
|
|
}
|
|
|
|
var AssingedGroups = Context.PermissionGroups.Where(x => x.ContextId == contextId).ToListAsync();
|
|
|
|
if (AssingedGroups.Result != null)
|
|
{
|
|
foreach (var group in AssingedGroups.Result)
|
|
{
|
|
var mappingRow = Context.PermissionContextMappings.Where(x => x.SubjectId == group.Id).ToListAsync();
|
|
if (mappingRow.Result == null)
|
|
{
|
|
//group has no permission but is assigned...
|
|
|
|
}
|
|
else if (mappingRow.Result.Count > 1)
|
|
{
|
|
//group has been assigned more than onece to same context
|
|
|
|
}
|
|
else
|
|
{
|
|
foreach (var mapping in mappingRow.Result)
|
|
{
|
|
result.Add(new AssignedPermissionModel(group.ContextId, group.Id, mapping.SubjectType, group.GroupName, mapping.Permissions));
|
|
}
|
|
}
|
|
|
|
}
|
|
}
|
|
foreach (var row in result)
|
|
{
|
|
Console.WriteLine($"GetPermissionsOfAssignedUsersAndGroupsAsyncByContextId: {row.ContextId}, {row.SubjectId}, {row.SubjectType}, {row.Name}, {row.PermissionsValue}");
|
|
}
|
|
return Task.FromResult(result);
|
|
}
|
|
|
|
|
|
|
|
//12. (IPermissionService) get permission groups for context
|
|
public Task<List<PermissionContextMapping>> GetPermissionsForContextByContextIdAsync(Guid contextId)
|
|
{
|
|
List<PermissionContextMapping> permissionContextMappings = new List<PermissionContextMapping>();
|
|
//get all Groups where the contextId is the same
|
|
var groups = Context.PermissionGroups.Where(x => x.ContextId == contextId).Select(x=>x.Id).ToHashSet();
|
|
permissionContextMappings = Context.PermissionContextMappings.Where(x => groups.Contains(x.SubjectId)).ToList();
|
|
|
|
//foreach (var item in groups.Result)
|
|
//{
|
|
// //get permissioncontextmapping for the group if there is, so we know what permissions the group has
|
|
// var pCm = Context.PermissionContextMappings.FirstOrDefault(x => x.SubjectId == item.Id);
|
|
// permissionContextMappings.Add(pCm);
|
|
//}
|
|
return Task.FromResult(permissionContextMappings);
|
|
}
|
|
|
|
//9. (IPermissionService) add user to permission group
|
|
public Task<bool> AddUserToPermissionGroupAsync(Guid permissionGroupId, Guid userId)
|
|
{
|
|
bool result = false;
|
|
using (var transaction = Context.Database.BeginTransaction())
|
|
{
|
|
//do we need to check if PermissionContextMappingId exists?
|
|
var permissionGroupUserMapping = new PermissionGroupUserMapping(userId, permissionGroupId);
|
|
Context.PermissionGroupUserMappings.Add(permissionGroupUserMapping);
|
|
Context.SaveChanges();
|
|
transaction.Commit();
|
|
result = true;
|
|
}
|
|
return Task.FromResult(result);
|
|
}
|
|
|
|
//8. (IPermissionService) create permission group
|
|
public Task<bool> CreatePermissionGroupAsync(PermissionGroup permissionGroup, TiamServiceProvider serviceProvider)
|
|
{
|
|
bool result = false;
|
|
using (var transaction = Context.Database.BeginTransaction())
|
|
{
|
|
var existingPermissionGroup = Context.PermissionGroups.FirstOrDefault(x => x.GroupName == permissionGroup.GroupName)?.GroupName;
|
|
if (existingPermissionGroup == null)
|
|
{
|
|
//create permission type 1 for the group
|
|
var permissionType = new PermissionsType(serviceProvider.Id, "View");
|
|
Context.PermissionsTypes.Add(permissionType);
|
|
|
|
//Create PermissionContextMapping for the group
|
|
|
|
//create Id for the group
|
|
Guid Id = Guid.NewGuid();
|
|
permissionGroup.Id = Id;
|
|
var permissionContextMapping = new PermissionContextMapping(serviceProvider.Id, Id, PermissionContextMappingSubjectType.Group, 1, true);
|
|
Context.PermissionContextMappings.Add(permissionContextMapping);
|
|
Context.PermissionGroups.Add(permissionGroup);
|
|
Context.SaveChanges();
|
|
transaction.Commit();
|
|
result = true;
|
|
}
|
|
else
|
|
{
|
|
//group with same name already exists
|
|
result = false;
|
|
}
|
|
}
|
|
return Task.FromResult(result);
|
|
}
|
|
|
|
public List<AssignedUser> GetAssingedUsersInPermissionGroupByGroupId(Guid groupId)
|
|
{
|
|
return Context.GetAssignedUsersByPermissionGroupId(groupId).ToList();
|
|
//List<AssignedUser> assignedUsers = new List<AssignedUser>();
|
|
|
|
////let's get the permissioncontextmapping for the group
|
|
//var pCm = Context.PermissionContextMappings.FirstOrDefault(x => x.SubjectId == groupId);
|
|
//Guid pCmId = pCm.Id;
|
|
|
|
////let's get the permissiongroupusermappings for the permissioncontextmapping
|
|
//var pGum = Context.PermissionGroupUserMappings.Where(x => x.PermissionContextMappingId == pCmId).ToList();
|
|
//if (pGum.Count > 0)
|
|
//{
|
|
// foreach (var group in pGum)
|
|
// {
|
|
// assignedUsers.Add(Context.AssignedUsers.FirstOrDefault(x => x.Id == group.AssignedUserId));
|
|
// }
|
|
|
|
//}
|
|
|
|
//return Task.FromResult(assignedUsers);
|
|
}
|
|
|
|
#endregion
|
|
|
|
#region Products
|
|
|
|
//19. (IServiceProviderDataService) Create product
|
|
public Task<bool> CreateProductAsync(TiamProduct product)
|
|
{
|
|
|
|
|
|
|
|
Context.Products.Add(product);
|
|
Console.WriteLine($"Saving product to db {product.Id}, {product.Name}, {product.OwnerId}");
|
|
return Context.SaveChangesAsync().ContinueWith(x => x.Result > 0);
|
|
|
|
}
|
|
|
|
//20. (IServiceProviderDataService) Update product
|
|
public Task<bool> UpdateProductAsync(TiamProduct product)
|
|
{
|
|
var dbProduct = Context.Products.FirstOrDefault(u => u.Id == product.Id);
|
|
if (dbProduct != null)
|
|
{
|
|
dbProduct = product;
|
|
Context.Products.Update(dbProduct);
|
|
return Context.SaveChangesAsync().ContinueWith(x => x.Result > 0);
|
|
}
|
|
else
|
|
{
|
|
throw new Exception("Product not found");
|
|
}
|
|
}
|
|
|
|
//21. (IServiceProviderDataService) delete product
|
|
public Task<bool> DeleteProductByIdAsync(Guid productId)
|
|
{
|
|
return TransactionAsync(ctx =>
|
|
{
|
|
ctx.DeleteProductById(productId);
|
|
|
|
//var dbProduct = ctx.Products.FirstOrDefault(u => u.Id == id);
|
|
//if (dbProduct != null)
|
|
//{
|
|
// ctx.CleanUpAndRemoveAssignedUser();
|
|
// //get assignedUsers for this product
|
|
// var assignedUsers = ctx.AssignedUsers.Where(x => x.ContextId == id).ToList();
|
|
// //remove assignedUsers
|
|
// foreach (var item in assignedUsers)
|
|
// {
|
|
// await RemoveAssignedUserByUserIdAsync(item.Id);
|
|
// }
|
|
|
|
// return true;
|
|
//}
|
|
|
|
return true;
|
|
});
|
|
}
|
|
|
|
//4. (IPermissionService) AssignPermissionToUserForContextAsync
|
|
public Task<bool> AssignPermissionToUserForContextAsync(AssignedUser assignedUser, PermissionsType permission)
|
|
{
|
|
var _assIgnedUser = Context.AssignedUsers.FirstOrDefault(x => x.Id == assignedUser.Id);
|
|
|
|
if(_assIgnedUser != null)
|
|
{
|
|
//user exists
|
|
var _permissionInt = GetPermissionFromPermissionType(permission);
|
|
|
|
var permissionContextMapping = Context.PermissionContextMappings.FirstOrDefault(x => x.SubjectId == assignedUser.Id);
|
|
var currentPermissions = permissionContextMapping.Permissions;
|
|
var newPermissions = currentPermissions + _permissionInt.Result;
|
|
permissionContextMapping.Permissions = newPermissions;
|
|
return Context.SaveChangesAsync().ContinueWith(x => x.Result > 0);
|
|
}
|
|
else
|
|
{
|
|
//user does not exist, let's create it
|
|
return Task.FromResult(false);
|
|
}
|
|
}
|
|
|
|
#endregion
|
|
|
|
|
|
#region AssignedUsers
|
|
|
|
//22. (IServiceProviderDataService) Create assignedUser
|
|
public Task<AssignedUser> CreateAssignedUserAsync(AssignedUser assignedUser)
|
|
{
|
|
Context.AssignedUsers.Add(assignedUser);
|
|
Console.WriteLine($"Saving assignedUser to db {assignedUser.Id}, {assignedUser.ContextId}, {assignedUser.EmployeeUserId}, {assignedUser.UserRoles}");
|
|
return Context.SaveChangesAsync().ContinueWith(x => assignedUser);
|
|
}
|
|
|
|
//23. (IServiceProviderDataService) Get Assigned Users By ProductId
|
|
public Task<List<AssignedUser>> GetAssignedUsersByProductIdAsync(Guid productId)
|
|
{
|
|
return Context.AssignedUsers.Where(x => x.ContextId == productId).ToListAsync();
|
|
}
|
|
|
|
|
|
//24 . (IServiceProviderDataService) Remove Assigned Users By Product Id
|
|
public Task RemoveAssignedUsersByContextId(Guid contextId)
|
|
{
|
|
using (var transaction = Context.Database.BeginTransaction())
|
|
{
|
|
var assignedUsers = Context.AssignedUsers.Where(x => x.ContextId == contextId).ToList();
|
|
//remove assignedUsers
|
|
|
|
return Context.SaveChangesAsync().ContinueWith(x => x.Result > 0);
|
|
|
|
}
|
|
}
|
|
|
|
//25. (IServiceProviderDataService) Remove Assigned from product by assignedUserId
|
|
public Task<bool> RemoveAssignedUserAsync(AssignedUser assignedUser, bool removeFromGroups)
|
|
{
|
|
return TransactionAsync(ctx =>
|
|
{
|
|
var result = false;
|
|
var assignedUserToRemove = ctx.AssignedUsers.FirstOrDefault(x => x.Id == assignedUser.Id);
|
|
|
|
//remove assignedUsers
|
|
if (assignedUserToRemove == null) return false;
|
|
|
|
|
|
if (removeFromGroups)
|
|
{
|
|
//remove permissiongroupusermappings
|
|
ctx.RemoveAssingedUserFromPermissionGroups(assignedUserToRemove.Id);
|
|
}
|
|
|
|
ctx.AssignedUsers.Remove(assignedUserToRemove);
|
|
|
|
|
|
return result;
|
|
});
|
|
}
|
|
|
|
//public Task RemoveAssignedUserByUserIdAsync(Guid assignedUserId)
|
|
//{
|
|
// return TransactionAsync(ctx =>
|
|
// {
|
|
// var assignedUser = ctx.AssignedUsers.FirstOrDefault(x => x.Id == assignedUserId);
|
|
// //remove assignedUsers
|
|
// if (assignedUser == null) return false;
|
|
|
|
// //CleanUp
|
|
// //remove permissioncontextmappings
|
|
// ctx.RemoveAssignedUserContextMappingBySubjectId(assignedUserId);
|
|
// //remove permissiongroupusermappings
|
|
// ctx.RemoveAssingedUserFromAllProductPermissionGroups(assignedUserId);
|
|
|
|
// return true;
|
|
// });
|
|
//}
|
|
|
|
//public Task RemoveAssignedUserContextMappingByAssignedUserId(Guid assignedUserId)
|
|
//{
|
|
// using (var transaction = Context.Database.BeginTransaction())
|
|
// {
|
|
// PermissionContextMapping? contextMapping = Context.PermissionContextMappings.FirstOrDefault(x => x.SubjectId == assignedUserId);
|
|
// //remove assignedUsers
|
|
// if(contextMapping != null)
|
|
// {
|
|
// Context.PermissionContextMappings.Remove(contextMapping);
|
|
// }
|
|
// return Context.SaveChangesAsync().ContinueWith(x => x.Result > 0);
|
|
|
|
// }
|
|
//}
|
|
|
|
|
|
//public Task RemoveAssingedUserFromAllProductPermissionGroups(Guid assignedUserId)
|
|
//{
|
|
// using (var transaction = Context.Database.BeginTransaction())
|
|
// {
|
|
// var permissionGroupUserMapping = Context.PermissionGroupUserMappings.Where(x => x.AssignedUserId == assignedUserId);
|
|
// //remove assignedUsers
|
|
|
|
// if (permissionGroupUserMapping != null)
|
|
// {
|
|
// foreach (var item in permissionGroupUserMapping)
|
|
// {
|
|
// Context.PermissionGroupUserMappings.Remove(item);
|
|
// }
|
|
// }
|
|
// return Context.SaveChangesAsync().ContinueWith(x => x.Result > 0);
|
|
|
|
// }
|
|
//}
|
|
|
|
|
|
#endregion
|
|
|
|
}
|
|
}
|