/// <summary> /// Make a new model and inject dto values /// </summary> /// <typeparam name="TModel">The type of the model</typeparam> /// <param name="dto">The dto object that contains the property values</param> /// <returns>A new instance of TModel with the same property values of this dto</returns> public static TModel ToModel <TModel>(this IDto <TModel> dto) where TModel : class, new() { var model = new TModel(); dto.UpdateModel(model); return(model); }