DocSas/PropertyService.Domain/ModelView/property/PropertyProvider.cs
/// <summary>
/// save role property as an asynchronous operation.
/// </summary>
/// <param name="propVM">The property vm.</param>
/// <returns>Task&lt;DSCResponse&gt;.</returns>
save role property as an asynchronous operation.
save role property as an asynchronous operation .
public async Task<DSCResponse> SaveRolePropertyAsync(PropertyAccessForm propVM)
        {
            var msg = new Dictionary<string, string>();
            var response = new DSCResponse();
            var issuccess = false;
            var management = await _appCommon.GetManagementUserAsync(propVM.UserId);
            if (management != null)
            {
                var propRole = new List<PropertyAccess>();
                foreach (var item in propVM.PropertyInfos)
                {
                    if (item.ManagementUserId  != management.Id)
                    {
                        continue;
                    }
                    propRole.Add(new PropertyAccess() { RoleId = propVM.RoleId, PropertyInformationId = item.Id, IsValid = true, AddedDateUtc = DateTime.UtcNow, ModifiedDateUtc = DateTime.UtcNow });
                }
                await _propAccessRepo.AddAsync(propRole);
                issuccess = true;
            }
            response.ResponseData = issuccess;
            response.ErrorMessage = msg;
            return response;
        }
public async Task < DSCResponse > SaveRolePropertyAsync ( PropertyAccessForm propVM ) { var msg = new Dictionary < string , string > ( ) ; var response = new DSCResponse ( ) ; var issuccess = false ; var management = await _appCommon . GetManagementUserAsync ( propVM . UserId ) ; if ( management != null ) { var propRole = new List < PropertyAccess > ( ) ; foreach ( var item in propVM . PropertyInfos ) { if ( item . ManagementUserId != management . Id ) { continue ; } propRole . Add ( new PropertyAccess ( ) { RoleId = propVM . RoleId , PropertyInformationId = item . Id , IsValid = true , AddedDateUtc = DateTime . UtcNow , ModifiedDateUtc = DateTime . UtcNow } ) ; } await _propAccessRepo . AddAsync ( propRole ) ; issuccess = true ; } response . ResponseData = issuccess ; response . ErrorMessage = msg ; return response ; }
save role property as an asynchronous operation.
save role property as an asynchronous operation .
None
propVM
PropertyAccessForm
The property vm.
The property vm .