”@

Home 

c# Programming Glossary: objecta

Return an object of one class in a generic method

http://stackoverflow.com/questions/10902042/return-an-object-of-one-class-in-a-generic-method

Generic method as public T MethodGeneric T int x ClassA objectA new ClassA ClassB objectB new ClassB if x 2 return objectA.. new ClassA ClassB objectB new ClassB if x 2 return objectA else return objectB c# generics share improve this question.. static T MethodGeneric T where T class int x 2 ClassA objectA new ClassA ClassB objectB new ClassB if x 2 return objectA..

Insert new object with existing object

http://stackoverflow.com/questions/5416323/insert-new-object-with-existing-object

are set. The object B property is set as follows objectA.myObjectB objectB cmbBObjects.selectedItem Then I create a repository.. cmbBObjects.selectedItem Then I create a repository for objectA and call the save method. In this save method I have this codeĀ±.. ObjectA obj using MyContext context new MyContext context.objectAs.AddObject obj context.SaveChanges This code does save a new..