Vogen icon indicating copy to clipboard operation
Vogen copied to clipboard

It is not fully compatible with ASP.NET 8

Open arteny opened this issue 1 year ago • 0 comments

Describe the feature

Only case you described in doc is adding full route for each controller's method. But it is not very useful case. Most of cases route generated automatically for common rules for controller and method has only [HttpGet] attribute. But it is not works in this case. Also it is not working for minimal API mechanism of Asp.Net For instance, the following code

app.MapGet("test/{eventId}", (EventId eventId) => Results.Ok(eventId));

generates the error: error ASP0020: Parameter 'eventId' of type EventId should define a bool TryParse(string, IFormatProvider, out EventId) method, or implement IParsable<EventId> (https://aka.ms/aspnet/analyzers) which is fixing by adding ValueObject's method:

	public static bool TryParse(string value, IFormatProvider provider, out EventId eventId)
	{
		eventId= From(value);
		return true;
	}

Could you please to add more compatiblity with Asp.Net?

arteny avatar Feb 08 '24 22:02 arteny