/// <summary> /// Converts viewmodel to model /// </summary> /// <param name="model">The model.</param> /// <returns></returns> public static AppointmentLengthModel ToModel(this AppointmentLengthViewModel model) { if (model == null) { return(null); } var entity = new AppointmentLengthModel { AppointmentTypeID = model.AppointmentTypeID, AppointmentLengthID = model.AppointmentLengthID, AppointmentLength = model.AppointmentLength, ModifiedOn = model.ModifiedOn }; return(entity); }
/// <summary> /// To the view model. /// </summary> /// <param name="entity">The entity.</param> /// <returns></returns> public static AppointmentLengthViewModel ToViewModel(this AppointmentLengthModel entity) { if (entity == null) { return(null); } var model = new AppointmentLengthViewModel { AppointmentTypeID = entity.AppointmentTypeID, AppointmentLength = entity.AppointmentLength, AppointmentLengthID = entity.AppointmentLengthID, ModifiedOn = entity.ModifiedOn }; return(model); }