Exemple #1
0
        public static Permission ToPermissionDomainModel(this PermissionApiModel permissionApiModel)
        {
            var permission = new Permission
            {
                Id                  = permissionApiModel.Id ?? Guid.Empty,
                Grain               = permissionApiModel.Grain,
                Name                = permissionApiModel.Name,
                SecurableItem       = permissionApiModel.SecurableItem,
                CreatedDateTimeUtc  = permissionApiModel.CreatedDateTimeUtc,
                ModifiedDateTimeUtc = permissionApiModel.ModifiedDateTimeUtc,
                CreatedBy           = permissionApiModel.CreatedBy,
                ModifiedBy          = permissionApiModel.ModifiedBy
            };

            return(permission);
        }
Exemple #2
0
        public static PermissionApiModel ToPermissionApiModel(this Permission permission)
        {
            var permissionApiModel = new PermissionApiModel
            {
                Id                  = permission.Id,
                Grain               = permission.Grain,
                Name                = permission.Name,
                SecurableItem       = permission.SecurableItem,
                CreatedDateTimeUtc  = permission.CreatedDateTimeUtc,
                ModifiedDateTimeUtc = permission.ModifiedDateTimeUtc,
                CreatedBy           = permission.CreatedBy,
                ModifiedBy          = permission.ModifiedBy
            };

            return(permissionApiModel);
        }