Comments (3)
Good catch. I've never run into this issue. Feel free to add a PR with the fix if you'd like.
I don't use this utility for anything anymore but I can make the change at some point.
from typemerger.
I use the utility for merging data alot instead of building a whole duplicate of a model in come causes where model are not needed. Take a look at this code:
[HttpGet("")]
public async Task<IActionResult> Populate(int? limit, [FromQuery] CourseFilter filter)
{
var result = await courseService.PopulateAsync(limit, filter);
if (!result.Success) return StatusCode(result.Code, result);
var courseList = (Page<Course>)result.Data;
result.Data = TypeMerger.Ignore(() => courseList.Items).Merge(new
{
Items = courseList.Items.Select(course => TypeMerger.Merge(new
{ ImageUrl = assetService.GetPublicUrl(course.Image) }, course))
}, courseList);
return StatusCode(result.Code, result);
}
You'll notice that TypeMerger was used to merge image url into the data and return result.
from typemerger.
This is exactly what I used this for as well. I'm glad to hear you get use out of it.
I'll push out an update with the fix today or tomorrow. Thanks again for reporting the issue.
from typemerger.
Related Issues (6)
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from typemerger.