Exemplo n.º 1
0
        public static FriendModel ParseFriendRequestEntityToModel(Friends entity)
        {
            var model = new FriendModel();

            model.Status         = entity.Status;
            model.ActionDate     = entity.ActionDate;
            model.Id             = entity.UserId;
            model.FirstName      = entity.User.FirstName;
            model.LastName       = entity.User.LastName;
            model.ProfilePicture = entity.User.ProfilePicture;
            model.Phone          = entity.User.Phone;
            model.DateOfBirth    = entity.User.DateOfBirth.HasValue ? entity.User.DateOfBirth.Value.ToShortDateString() : null;
            model.Email          = entity.User.Email;
            model.City           = entity.User.City;
            model.AboutMe        = entity.User.AboutMe;
            model.Gender         = entity.User.Gender;
            model.State          = entity.User.State;


            return(model);
        }
Exemplo n.º 2
0
        public static Friends ParseFriendModelToEntiy(FriendModel model)
        {
            var entity = new Friends();

            entity.Status                = model.Status;
            entity.ActionDate            = model.ActionDate;
            entity.Id                    = model.Id;
            entity.Friend.FirstName      = model.FirstName;
            entity.Friend.LastName       = model.LastName;
            entity.Friend.ProfilePicture = model.ProfilePicture;
            entity.Friend.Phone          = model.Phone;
            if (!String.IsNullOrEmpty(model.DateOfBirth))
            {
                entity.Friend.DateOfBirth = Convert.ToDateTime(model.DateOfBirth);
            }
            entity.Friend.Email   = model.Email;
            entity.Friend.City    = model.City;
            entity.Friend.AboutMe = model.AboutMe;
            entity.Friend.Gender  = model.Gender;
            entity.Friend.State   = model.State;

            return(entity);
        }
Exemplo n.º 3
0
        public static FriendModel ParseFriendRequestEntityToModel(Friends entity)
        {
            var model = new FriendModel();
            model.Status = entity.Status;
            model.ActionDate = entity.ActionDate;
            model.Id = entity.UserId;
            model.FirstName = entity.User.FirstName;
            model.LastName = entity.User.LastName;
            model.ProfilePicture = entity.User.ProfilePicture;
            model.Phone = entity.User.Phone;
            model.DateOfBirth = entity.User.DateOfBirth.HasValue ? entity.User.DateOfBirth.Value.ToShortDateString() : null;
            model.Email = entity.User.Email;
            model.City = entity.User.City;
            model.AboutMe = entity.User.AboutMe;
            model.Gender = entity.User.Gender;
            model.State = entity.User.State;


            return model;
        }
Exemplo n.º 4
0
        public static Friends ParseFriendModelToEntiy(FriendModel model)
        {
            var entity = new Friends();
            entity.Status = model.Status;
            entity.ActionDate = model.ActionDate;
            entity.Id = model.Id;
            entity.Friend.FirstName = model.FirstName;
            entity.Friend.LastName = model.LastName;
            entity.Friend.ProfilePicture = model.ProfilePicture;
            entity.Friend.Phone = model.Phone;
            if (!String.IsNullOrEmpty(model.DateOfBirth))
            {
                entity.Friend.DateOfBirth = Convert.ToDateTime(model.DateOfBirth);
            }
            entity.Friend.Email = model.Email;
            entity.Friend.City = model.City;
            entity.Friend.AboutMe = model.AboutMe;
            entity.Friend.Gender = model.Gender;
            entity.Friend.State = model.State;

            return entity;
        }