Skip to content
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

Any quick startup guide #76

Open
kirya522 opened this issue Apr 28, 2020 · 8 comments
Open

Any quick startup guide #76

kirya522 opened this issue Apr 28, 2020 · 8 comments

Comments

@kirya522
Copy link

As I saw in the docks, there is no quick startup guide.
I was developing the same thing before saw this framework, I want to try but template is in dotnet 2.2 an obsolete one; I updated packages but there are some obsolete reference. Maybe it will be useful to update template too. This framework is a great implementation of idea, but it lacks of documentation and as a result community share.

@oskardudycz
Copy link
Owner

@kirya522 thank you a lot for creating an issue and the good words. Currently, this framework was mostly for my internal use (plus @mjendza 😉 ).
For sure the documentation part needs some love. For the new features that I'm adding - I'm trying to add some samples, but they're as you said - not enough.
Could you provide more details of the examples of the things that would be especially useful for you? Also what parts of GoldenEye are the most interesting for you?

@kirya522
Copy link
Author

There are a lot of cases, where framework will be useful, starting from simple crud to DDD. I am developing the same idea framework, but it's easier to take a complete one). I understand the idea, but sample project does not include all the actual features. I hate dotnet for not having a standard approach how to get data from datasource(like an abstraction to data not just sql or ef). There are a lot of implementations of repositories and unit of work, but nothing from ms at all. Goldeneye is a great abstraction to data access part. Goldeneye DDD is a great usage of MediatR and it is easy to write domain logic. I am not a professional framework developer, but maybe in future it will be useful to split projects in different solutions.

@oskardudycz
Copy link
Owner

@kirya522 yes, splitting is an option. For now, I at least split that into a separate project and nugets.

I'll try to provide some guidance on the CQRS and DDD part and more advanced sample.

At least now I have more motivation after seeing your interest and good words :)

@kirya522
Copy link
Author

kirya522 commented May 3, 2020

I don't understand how to use code-first in current realization.
How you manage it?
Just create entities in db manually or there is a way to use migrations with current logic?
Can you please show a real example of usage?(with mock data of course) or just a guideline how to manage it.
I will write documentation by myself if I understand how to make an app(just an api part) from absolutely zero codebase(empty db, no classes). There are a lot of guides how to create code-first with efcore but there is a huge problem when you separate logic and apis and setup looks like

services.AddEntityFrameworkNpgsql().AddDbContext<RecalculateContext>((sp, opt) =>
            {
                opt.UseNpgsql(Configuration.GetConnectionString("pgarch"),
                    b => b.MigrationsAssembly("Recalculate.WebApi"));
                opt.UseInternalServiceProvider(sp);
            });

@oskardudycz
Copy link
Owner

oskardudycz commented May 3, 2020

In general, GoldenEye does not aim to replace the way of working with frameworks but to reduce the boilerplate and dull repetitive work). Having that, you can still set up the EF DbContext as you did.

However, to be able to set up the migrations inside the package/dll that contains the domain logic - so eg. having two modules Orders and Shipment, both having their own DbContext and migrations inside them. You can use IDesignTimeDbContextFactory. If there is an instance of that class located in the DLL then it will be used to generate migrations. See more: https://docs.microsoft.com/en-us/ef/core/miscellaneous/cli/dbcontext-creation or https://blog.tonysneed.com/2018/12/20/idesigntimedbcontextfactory-and-dependency-injection-a-love-story/.

I added on my feature branch such logic in commit 82e0480#diff-ecc8528ab4cc892a7d7baa54d0f1792aR34. I added also base classes to simplify that. It's not yet full sample but it shows how it works. I'll provide a full sample for EF later on.

There are also helpers for running the migrations in the generic way (without knowing the exact type of dbcontext).

@AndiRudi
Copy link

I am also new to the project and couldn't find anything close (except Eventstore Db). I think this project has massive opportunities. As @kirya522 mentioned the entrance barrier should be lower.

Maybe it makes sense to separate the project into the core development and the ready made packages. As a started you probably don't want to read about all the details and how it is made. You want to have a couple of steps to get a hello world project and then you want to get stuff done. Maybe a while later you are interested in all the details. I really look forward to (support) this project.

But it is a very good start already!

@oskardudycz
Copy link
Owner

@AndiRudi thank you for the feedback and other issues. I'm actively working on improving that. Last few days, I've made a big move on migrating to .NET 5 and aligning the public API. I didn't want to market much this library before stabilizing that.

To make less confusion, I also unified a few packages into a single one. Previously it was:

  • GoldenEye.Shared.Core,
  • GoldenEye.Core.Backend,
  • GoldenEye.Core.DDD

Not it will be just single: GoldenEye.

Ok, almost. Exact libraries will get their own packages (so Marten, Dapper, Entity Framework, Kafka etc.).

I'm currently working on migrating my Event Sourcing samples from https://github.com/oskardudycz/EventSourcing.NetCore. See #84.

How does it sound for you?

Thank you for the kind words and constructive criticism - highly appreciated! I'd be happy to get support from you.
After that, I'll update the template and make sure that's more real-world and read to jump-start into coding.

@oskardudycz
Copy link
Owner

@AndiRudi and sample are merged! Still, some things need polishing before the release.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants