- Timestamp:
- 09/25/17 15:36:54 (7 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/HiveProjectManagement/HeuristicLab.Services.Hive/3.3/Converter.cs
r14185 r15379 333 333 #endregion 334 334 335 #region ResourcePermission 336 public static DT.ResourcePermission ToDto(this DA.ResourcePermission source) { 337 if (source == null) return null; 338 return new DT.ResourcePermission { 339 ResourceId = source.ResourceId, 335 #region Project 336 public static DT.Project ToDto(this DA.Project source) { 337 if (source == null) return null; 338 return new DT.Project { 339 Id = source.ProjectId, 340 ParentProjectId = source.ParentProjectId, 341 DateCreated = source.DateCreated, 342 Name = source.Name, 343 Description = source.Description, 344 OwnerUserId = source.OwnerUserId, 345 StartDate = source.StartDate, 346 EndDate = source.EndDate 347 }; 348 } 349 public static DA.Project ToEntity(this DT.Project source) { 350 if (source == null) return null; 351 var result = new DA.Project(); 352 source.CopyToEntity(result); 353 return result; 354 } 355 public static void CopyToEntity(this DT.Project source, DA.Project target) { 356 if ((source == null) || (target == null)) return; 357 target.ProjectId = source.Id; 358 target.ParentProjectId = source.ParentProjectId; 359 target.DateCreated = source.DateCreated; 360 target.Name = source.Name; 361 target.Description = source.Description; 362 target.OwnerUserId = source.OwnerUserId; 363 target.StartDate = source.StartDate; 364 target.EndDate = source.EndDate; 365 } 366 #endregion 367 368 #region ProjectPermission 369 public static DT.ProjectPermission ToDto(this DA.ProjectPermission source) { 370 if (source == null) return null; 371 return new DT.ProjectPermission { 372 ProjectId = source.ProjectId, 340 373 GrantedUserId = source.GrantedUserId, 341 374 GrantedByUserId = source.GrantedByUserId 342 375 }; 343 376 } 344 public static DA. ResourcePermission ToEntity(this DT.ResourcePermission source) {345 if (source == null) return null; 346 var result = new DA. ResourcePermission();347 source.CopyToEntity(result); 348 return result; 349 } 350 public static void CopyToEntity(this DT. ResourcePermission source, DA.ResourcePermission target) {351 if ((source == null) || (target == null)) return; 352 target. ResourceId = source.ResourceId;377 public static DA.ProjectPermission ToEntity(this DT.ProjectPermission source) { 378 if (source == null) return null; 379 var result = new DA.ProjectPermission(); 380 source.CopyToEntity(result); 381 return result; 382 } 383 public static void CopyToEntity(this DT.ProjectPermission source, DA.ProjectPermission target) { 384 if ((source == null) || (target == null)) return; 385 target.ProjectId = source.ProjectId; 353 386 target.GrantedUserId = source.GrantedUserId; 354 387 target.GrantedByUserId = source.GrantedByUserId;
Note: See TracChangeset
for help on using the changeset viewer.