public UserPlan(Protobuf.UserPlan userPlanPb) { this.Id = userPlanPb.Id; this.UserId = userPlanPb.UserId; this.RouteId = userPlanPb.RouteId; this.FromDate = DateTime.FromBinary(userPlanPb.FromDate); this.ToDate = DateTime.FromBinary(userPlanPb.ToDate); this.Route = new Route(userPlanPb.Route); this.User = new User(userPlanPb.User); }
public Protobuf.UserPlan ToPBMessage() { Protobuf.UserPlan userPlanPb = new Protobuf.UserPlan(); userPlanPb.Id = this.Id; userPlanPb.UserId = this.UserId; userPlanPb.RouteId = this.RouteId; userPlanPb.FromDate = this.FromDate.ToBinary(); userPlanPb.ToDate = this.ToDate.ToBinary(); userPlanPb.Route = this.Route.ToPBMessage(); userPlanPb.User = this.User.ToPBMessage(); return(userPlanPb); }