Inheritance: System.Data.Objects.DataClasses.EntityObject
Exemplo n.º 1
0
 /// <summary>
 /// Deprecated Method for adding a new object to the Sources EntitySet. Consider using the .Add method of the associated ObjectSet&lt;T&gt; property instead.
 /// </summary>
 public void AddToSources(Source source)
 {
     base.AddObject("Sources", source);
 }
Exemplo n.º 2
0
 /// <summary>
 /// Create a new Source object.
 /// </summary>
 /// <param name="sourceId">Initial value of the SourceId property.</param>
 /// <param name="sourceTypeId">Initial value of the SourceTypeId property.</param>
 /// <param name="name">Initial value of the Name property.</param>
 /// <param name="createdDate">Initial value of the CreatedDate property.</param>
 /// <param name="modifiedDate">Initial value of the ModifiedDate property.</param>
 public static Source CreateSource(global::System.Int32 sourceId, global::System.Int32 sourceTypeId, global::System.String name, global::System.DateTime createdDate, global::System.DateTime modifiedDate)
 {
     Source source = new Source();
     source.SourceId = sourceId;
     source.SourceTypeId = sourceTypeId;
     source.Name = name;
     source.CreatedDate = createdDate;
     source.ModifiedDate = modifiedDate;
     return source;
 }
Exemplo n.º 3
0
        public SourceData Insert(SourceData data)
        {
            using (var ctx = Csla.Data.ObjectContextManager<ApplicationEntities>
                           .GetManager(Database.ApplicationConnection, false))
            {
                var source = new Source();

                DataMapper.Map(data, source);

                ctx.ObjectContext.AddToSources(source);

                ctx.ObjectContext.SaveChanges();

                data.SourceId = source.SourceId;

                return data;
            }
        }
Exemplo n.º 4
0
 private void Fetch(Source source, SourceData sourceData)
 {
     DataMapper.Map(source, sourceData);
 }
Exemplo n.º 5
0
        public SourceData Update(SourceData data)
        {
            using (var ctx = Csla.Data.ObjectContextManager<ApplicationEntities>
                         .GetManager(Database.ApplicationConnection, false))
            {
                var source =
                    new Source
                    {
                        SourceId = data.SourceId,
                        SourceTypeId = data.SourceTypeId
                    };

                ctx.ObjectContext.Sources.Attach(source);

                DataMapper.Map(data, source);

                ctx.ObjectContext.SaveChanges();

                return data;
            }
        }
Exemplo n.º 6
0
 internal static void Map(SourceData source, Source destination)
 {
     destination.SourceId = source.SourceId;
     destination.SourceTypeId = source.SourceTypeId;
     destination.Name = source.Name;
     destination.CreatedDate = source.CreatedDate;
     destination.ModifiedDate = source.ModifiedDate;
 }