-
Notifications
You must be signed in to change notification settings - Fork 63
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Please help with brief steps to get ASP.Net Core breeze server up #58
Comments
Hi @bancroftway , I created a sample project here . This includes the basic setup you're looking for. These are the steps I took to get things working:
Then in the web application project:
public void ConfigureServices(IServiceCollection services)
{
// Add framework services.
var mvcBuilder = services.AddMvc();
mvcBuilder.AddJsonOptions(opt => {
var ss = JsonSerializationFns.UpdateWithDefaults(opt.SerializerSettings);
var resolver = ss.ContractResolver;
if (resolver != null)
{
var res = resolver as DefaultContractResolver;
res.NamingStrategy = null; // <<!-- this removes the camelcasing
}
});
mvcBuilder.AddMvcOptions(o => { o.Filters.Add(new GlobalExceptionFilter()); });
services.AddScoped<SchoolContext>(_ => new SchoolContext(Configuration.GetConnectionString("SchoolContext")));
}
[Route("breeze/[controller]/[action]")]
[BreezeQueryFilter]
public class SchoolModelController : Controller
{
private SchoolPersistenceManager PersistenceManager;
// called via DI
public SchoolModelController(SchoolContext context)
{
PersistenceManager = new SchoolPersistenceManager(context);
}
[HttpGet]
public IActionResult Metadata()
{
return Ok(PersistenceManager.Metadata());
}
[HttpPost]
public SaveResult SaveChanges([FromBody] JObject saveBundle)
{
return PersistenceManager.SaveChanges(saveBundle);
}
[HttpGet]
public IQueryable<Student> Students()
{
return PersistenceManager.Context.Students.Include("Enrollments");
}
}
internal class SchoolPersistenceManager : EFPersistenceManager<SchoolContext>
{
public SchoolPersistenceManager(SchoolContext context) : base(context) { }
// additional stuff goes here. Checkout the NorthwindIBModelController of the Breeze.AspNetCore.InternalTest.sln in the breeze.server.net repo
// https://github.com/Breeze/breeze.server.net/blob/master/Tests/Test.AspNetCore/Controllers/NorthwindIBModelController.cs
} Good luck! |
Nope! Not working with ASP.NET Core 2.0. Libraries on nuget are build using .net 4.6.1 and therefore incomplatible... |
+1 for ASP.NET Core + EF Core 2.0. Could you pls advise if compatibility with these is on your roadmap? |
We are definitely planning on working on this starting in the next few weeks. Will advise of progress and expected timeframe once we start. |
Hi there is any progress on this ?😊 |
I'm a just finishing this up now. Should be putting it up on Nuget within a few days - but the current version ( in test) is already checked into GitHub under breeze.server.net/aspnetcore folder. ( support for both EFCore and EF6 is provided) and an example of sample servers can be found in breeze.server.net/tests/( Test.AspNetCore.EFCore and Test.AspNetCore.EF6). |
I have all of this working in dotnet core 2.0.....ef core + webapi core + breeze aspnetcore + dotnet-cli + ef-cli https://github.com/mikemichaelis/dnc My persistence layer is SQL Server 2017 running in a Linux Docker container. See ya Windows........ |
Hi
Thanks a lot
Now Is working on my project too..
BR
2018-02-22 20:01 GMT+01:00 Mike Michaelis <[email protected]>:
… I have all of this working in dotnet core 2.0.....ef core + webapi core +
breeze aspnetcore + dotnet-cli + ef-cli
https://github.com/mikemichaelis/dnc
My persistence layer is SQL Server 2017 running in a Linux Docker
container. See ya Windows........
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
<#58 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AHErJeom9uxXfLswslgrPddZX0bwIawzks5tXbmJgaJpZM4OR7r9>
.
|
Anybody got a Breeze client app working with this .net core backend? https://github.com/mikemichaelis/dnc I would love to see the client code |
Is this still open because the breezejs official repo does not yet support dotnet core 2.x? Would be great to have official support. Breeze is a great help for building our applications! @mikemichaelis, we'll still use your dnc repo if we need to. |
Just updated both Asp.net and AspNetCore nugets. For ASP.NET Core with EF Core use the latest versions of Breeze.Core, Breeze.Persistence, Breeze.Persistence.EFCore and Breeze.AspNetCore.NetCore |
if you know how muuuuuchhhhhhhhhhhhhhhhhh i just waited for this message , hope it works with no bug, |
Thanks, please post back with any issues ... or successes. We have run our full test suite against the new ASP.Net Core and EF Core impl, so the basics should all be there, but edge cases can obviously still occur. |
Any chance we could get some docs? |
I finally built a demo project, with steps to create a .NET Core + EF Core server |
Note that the demos have been moved to https://github.com/Breeze/northwind-demo It's a bit out of date because the latest server sample is .NET 5, but the steps to get it going are exactly the same in .NET 6 and 7. |
Hello Steve, The steps in the .NET 5 server sample call for Startup.cs class configuration. The current templates for ASP.NET use only the program.cs. Can you guys update the sample or point to some updated example? And for an ASP.NET API, do we still need to call Thanks! |
@eqcb You are right - things have changed enough that we need to update the samples. We'll work on putting a .NET 8 sample up soon. For an ASP.NET API, I think you should use |
It would be extremely helpful to get a list of steps to get an ASP.Net Core Breeze server up, even if a full sample is a bit further away.
BTW, this maybe just me, but sometimes a series of step-by-step instructions are far more instructive than code samples...I found Brian Noyes' Pluralsight video far more helpful than the temphire sample.
The text was updated successfully, but these errors were encountered: