Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
10/09/10 19:11:54 (14 years ago)
Author:
jwolfing
Message:

#1196 added several Classes to DataAccess and DataTranfer

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/UserManagement/HeuristicLab.Services.Authentication/Convert.cs

    r4584 r4588  
    1313        #region User
    1414
     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>
    1520        public static aspnet_User ToEntity(User source)
    1621        {
    1722            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            };
    1930        }
    2031
     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>
    2137        public static User ToDataTransfer(aspnet_User source)
    2238        {
    2339            if (source == null) return null;
    24             return new User() { UserName=source.UserName };
     40            return new User()
     41            {
     42                UserName = source.UserName
     43            };
    2544        }
     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
    2660
    2761        #endregion
    2862
    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
    4680    }
    4781}
Note: See TracChangeset for help on using the changeset viewer.