[Mono-list] Embedded API: Method signature for ObjectSet<TEntity>.AddObject

jonathan at mugginsoft.com jonathan at mugginsoft.com
Mon Nov 18 23:17:38 UTC 2013


I cannot get the embedded method signature for the following method quite right:

ObjectSet<TEntity>.AddObject Method
public void AddObject(TEntity entity)
http://msdn.microsoft.com/en-us/library/dd487277(v=vs.110).aspx

All my efforts so far, such as below, fail to resolve the method (in Obj-C):

- (void)addObject:(DBMonoObjectRepresentation *)object
{
    DBMonoMethodRepresentation *methodRep = [DBMonoMethodRepresentation representationWithMonoMethodNamed:"AddObject(<TEntity>)"];
    methodRep.genericMonoType = [object monoType];
    [self invokeMethodRepresentation:methodRep withNumArgs:1, [object monoObject]];    
}


I have successfully resolved other generic methods such as below, but the declaration is somewhat different:

Enumerable.ToList<TSource> Method
public static List<TSource> ToList<TSource>(this IEnumerable<TSource> source)

    // ToList is an extension method defined as a static method on System.Linq.Enumerable
    // public static List<TSource> ToList<TSource>(this IEnumerable<TSource> source)
    // note that the generic parameter type must be obtained from the source
    DBMonoMethodRepresentation *methodRep = [DBMonoMethodRepresentation
                                             representationWithMonoMethodNamed:"ToList(System.Collections.Generic.IEnumerable`1<TSource>)"
                                                                    className:"System.Linq.Enumerable"
                                                                assemblyName:"System.Core"];

Jonathan













More information about the Mono-list mailing list