Last active
September 4, 2015 17:15
-
-
Save undeadcat/289423c4341a6275d8d9 to your computer and use it in GitHub Desktop.
Mono Generic Constraint Bug?
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| public abstract class ThingWithOrganizationId | |
| { | |
| public Guid OrganizationId; | |
| } | |
| public class Thing : ThingWithOrganizationId | |
| { | |
| } | |
| public abstract class BaseService<TConstraint> | |
| { | |
| public abstract void Save<T> (T newView) where T : TConstraint; | |
| } | |
| public class DerivedService:BaseService<Thing> | |
| { | |
| public override void Save<TThing>(TThing newView) | |
| { | |
| Console.WriteLine(newView.OrganizationId); | |
| } | |
| } |
Author
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
error CS1061: Type
TThing' does not contain a definition forOrganizationId' and no extension methodOrganizationId' of typeTThing' could be found. Are you missing an assembly reference?