This project is read-only.
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Configuration;
using DataAccess.Core;
using DataAccess.SqlServer;
using DataAccess.Core.Interfaces;

namespace SauceExample
  public class CrudClass
    public static IDataStore _dstore; //I recommend keeping the reference around

    static CrudClass()
      _dstore = SqlServerConnection.GetDataStore(ConfigurationManager.ConnectionStrings["SqlServer"].ConnectionString);

    public static void Main(string[] args)
      List<MyObject> items = new List<MyObject>();
      for (int i = 0; i < 10; i++) //create ten objects
        items.Add(new MyObject() { Name = Guid.NewGuid().ToString() });


      //each object will have the id set when its done so..
      items.ForEach(R => _dstore.DeleteObject(R)); //lets clean up

Last edited May 30, 2013 at 4:22 AM by iamkrillin, version 5


No comments yet.