예제 #1
0
    public void Find(Person p_id)
    {
        PersonDAL PDAL = new PersonDAL();

        try
        {
            PDAL.Find(p_id);
        }
        catch (Exception)
        {
            throw;
        }
        finally
        {
            PDAL = null;
        }
    }
예제 #2
0
        static void Main(string[] args)
        {
            try
            {
                PersonDAL dal = new PersonDAL();

                /*Console.WriteLine("Creando persona ...");
                 *
                 * dal.Create(new Person() { Id = Guid.NewGuid(),Name= "Peter",LastName = "Parker",Gender = true});
                 * Console.WriteLine("Registro creado");*/
                Console.WriteLine("Datos existentes:");

                var dataList = dal.Find(100);
                foreach (var person in dataList)
                {
                    Console.WriteLine($"Id: {person.Id} Nombre: {person.Name} Apellidos: {person.LastName}");
                }
            }
            catch (Exception ex)
            {
                Console.WriteLine($"Error creando registro {ex.Message}");
                throw;
            }
        }