C
C#2w ago
hutonahill

✅ using using to clear up ambiguous references.

I've to two method called index: Microsoft.EntityFrameworkCore.Index System.ComponentModel.DataAnnotations.Schema.Index i don't use the 2nd one. I want every mention of index to be interpreted as the first one. I've tried adding one of these using's to fix the problem, but nether works, it just says it Cannot resolve symbol 'Index'
using Index = Microsoft.EntityFrameworkCore.Index;
using IndexCB = System.ComponentModel.DataAnnotations.Schema.Index;
using Index = Microsoft.EntityFrameworkCore.Index;
using IndexCB = System.ComponentModel.DataAnnotations.Schema.Index;
25 Replies
jcotton42
jcotton422w ago
Do you need anything from Schema?
Angius
Angius2w ago
Alternatively: don't use data annotations and go with convention and fluent config
hutonahill
hutonahill2w ago
yep if i dont use data annotations how do i get stuff like strings of limited length?
jcotton42
jcotton422w ago
Wait, I don’t see an Index class in Schema in the docs.
Angius
Angius2w ago
No description
hutonahill
hutonahill2w ago
no idea what that is Got it! its IndexAttribute. not sure why is written different in the code...
jcotton42
jcotton422w ago
You can omit the Attribute suffix when using attributes. Wait, is this EF or EF Core?
hutonahill
hutonahill2w ago
Core?
jcotton42
jcotton422w ago
Oh jesus it’s from EF6.
Angius
Angius2w ago
Burn it
Angius
Angius2w ago
Yeah well throw away this namespace
hutonahill
hutonahill2w ago
i take it there is a better solution
Angius
Angius2w ago
Yes, don't use anything from this namespace
jcotton42
jcotton422w ago
Is this a new or existing app? I forget.
Want results from more Discord servers?
Add your server