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

Service with update fails to compile if there is more than one entity to update #7

Open
fjod opened this issue Feb 19, 2021 · 0 comments

Comments

@fjod
Copy link
Collaborator

fjod commented Feb 19, 2021

We must depict which entities to work with and allowed actions in TectureService realization. So I want to update two different entities in one file:

TectureService<Updates<ResourceSupply,Resource>>

Code looks like this:

To<Db>().Update<Resource>().Set(x => x.StockQuantity, 50).ByPk(1);
To<Db>().Update<ResourceSupply>().Set(x => x.Status, ResourceSupplyStatus.Closed).ByPk(2);

I receive compilation error for brackets inUpdate(). Interestingly, that compiler shows me that definition is not needed on the second line.

If I swap classes in TectureServices definition:
TectureService<Updates<Resource,ResourceSupply>>
error goes to To().Update() brackets.

Error:
Sample.cs(17, 13): [CS1929] 'Write<Db, Updates<Resource, ResourceSupply>>' does not contain a definition for 'Update' and the best extension method overload 'Extensions.Update<ResourceSupply>(Write<CommandChannel<Command>, Updates<ResourceSupply>>)' requires a receiver of type 'Write<CommandChannel<Command>, Updates<ResourceSupply>>'

tectureError

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

1 participant