PhotoSharingApp.AppService.Shared.Models.DocumentDB.UserDocument.CreateFromContract C# (CSharp) 메소드

CreateFromContract() 공개 정적인 메소드

Creates a UserDocument from a UserContract.
public static CreateFromContract ( UserContract contract ) : UserDocument
contract PhotoSharingApp.Portable.DataContracts.UserContract
리턴 UserDocument
        public static UserDocument CreateFromContract(UserContract contract)
        {
            return new UserDocument
            {
                Id = contract.UserId,
                ProfilePhotoUrl = contract.ProfilePhotoUrl,
                ProfilePhotoId = contract.ProfilePhotoId,
                GoldBalance = contract.GoldBalance,
                RegistrationReference = contract.RegistrationReference,
                CreatedAt = new DateDocument
                {
                    Date = contract.UserCreated
                },
                ModifiedAt = new DateDocument
                {
                    Date = contract.UserModified
                }
            };
        }