Kod z produkcji…

StepObject newObject = null;
if ((currentObjects
        .Where(
            o => o.GetType()
                  .GetProperties()
                  .Where(t => t.Name == "INT32")
                  .First()
                  .GetValue(o, null)
                  .ToString() 
                ==
                currentObject.GetType()
                    .GetProperties()
                    .Where(t => t.Name == "INT32")
                    .First()
                    .GetValue(currentObject, null)
                    .ToString()
        ).Count() > 0))
{
    newObject = currentObjects.Where(
                    o => o.GetType()
                          .GetProperties()
                          .Where(t => t.Name == "INT32")
                          .First()
                          .GetValue(o, null)
                          .ToString() 
                        ==
                        currentObject.GetType()
                            .GetProperties()
                            .Where(t => t.Name == "INT32")
                            .First()
                            .GetValue(currentObject, null)
                            .ToString()
                ).First();

    if (newObject.State.Equals(WorkStates.Approved))
        newObject = (currentObject.GetType()
                        .GetConstructor(new Type[0])
                        .Invoke(new object[0]) as StepObject);
}
else
{
   // removed for clarity
}

4 KOMENTARZE

  1. mozna bylo duzo rzeczy zrobic, ale jak widac nie zostaly zrobione :) dlaczego? nie wiem :) mnie sie nie pytaj – nie ja to pisalem :)

Comments are closed.