- Timestamp:
- 10/09/10 19:11:54 (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/UserManagement/HeuristicLab.Services.Authentication/Convert.cs
r4584 r4588 13 13 #region User 14 14 15 /// <summary> 16 /// converts data transfer object to data access objet 17 /// </summary> 18 /// <param name="source">data transfer object</param> 19 /// <returns>data access object</returns> 15 20 public static aspnet_User ToEntity(User source) 16 21 { 17 22 if (source == null) return null; 18 return new aspnet_User() { UserName = source.UserName }; 23 return new aspnet_User() 24 { 25 UserId = source.UserId, 26 UserName = source.UserName, 27 LastActivityDate = source.LastActivityDate, 28 ApplicationId = source.ApplicationId, 29 }; 19 30 } 20 31 32 /// <summary> 33 /// converts data access object to data transfer object 34 /// </summary> 35 /// <param name="source">data access object</param> 36 /// <returns>data transfer object</returns> 21 37 public static User ToDataTransfer(aspnet_User source) 22 38 { 23 39 if (source == null) return null; 24 return new User() { UserName=source.UserName }; 40 return new User() 41 { 42 UserName = source.UserName 43 }; 25 44 } 45 46 /// <summary> 47 /// converts data transfer object to data access object 48 /// </summary> 49 /// <param name="source">data transfer object</param> 50 /// <param name="target">data access object</param> 51 public static void ToEntity(User source, aspnet_User target) 52 { 53 if ((source != null) && (target != null)) 54 { 55 target.UserName = source.UserName; 56 } 57 58 } 59 26 60 27 61 #endregion 28 62 29 //#region Platform 30 //public static DT.Platform ToDto(DA.Platform source)31 //{ 32 // if (source == null) return null;33 // return new DT.Platform { Id = source.Id, Name = source.Name, Description = source.Description }; 34 //}35 //public static DA.Platform ToEntity(DT.Platform source) 36 //{37 // if (source == null) return null; 38 // return new DA.Platform { Id = source.Id, Name = source.Name, Description = source.Description };39 //} 40 //public static void ToEntity(DT.Platform source, DA.Platform target)41 //{ 42 // if ((source != null) && (target != null))43 // target.Id = source.Id; target.Name = source.Name; target.Description = source.Description; 44 //}45 //#endregion 63 64 #region Application 65 66 #endregion 67 68 #region Membership 69 70 #endregion 71 72 #region Role 73 74 #endregion 75 76 #region User 77 78 #endregion 79 46 80 } 47 81 }
Note: See TracChangeset
for help on using the changeset viewer.