Beispiel #1
0
 public static DataAttribute ToDataAttribute(this EFAttribute source)
 {
     return
         (source
          .match(
              v => {
         return DataAttribute.create_value(v.name, v.value);
     },
              c => {
         return DataAttribute.create_collection(c.name, c.attributes.Select(ToDataAttribute));
     }
              ));
 }
Beispiel #2
0
        public static P match <P>
            (this EFAttribute source
            , Func <ValueEFAttribute, P> value
            , Func <CollectionEFAttribute, P> collection)
        {
            if (source is ValueEFAttribute)
            {
                return(value(source as ValueEFAttribute));
            }

            if (source is CollectionEFAttribute)
            {
                return(collection(source as CollectionEFAttribute));
            }


            throw new Exception("Unexpected case");
        }
Beispiel #3
0
 public void remove(EFAttribute entity)
 {
     context.Atributes.Attach(entity);
     context.Entry(entity).State = EntityState.Deleted;
     context.Atributes.Remove(entity);
 }
Beispiel #4
0
 public void add(EFAttribute entity)
 {
     context.Atributes.Add(entity);
 }