Total disconnection in a large company

HR is an interesting business, here's how I see it (fails to) work:

Client: Your consultant X is fantastic, he's a legend.
Team Lead: He's an asset to the company.

Performance Review: Fantastic but there's room to grow.

Salary Review: Here's your below market average salary raise.

 

I'm at a stage in my life where choices are hard, and I think it will only get harder as I go.  I have a bit of money saved up.  The industry is nearing its peak.  I think it is time to take the dive and run my own business.

I vote with my feet.

Good bye!  Thanks for all the fish.

The funkiness that is LINQ.Contains

Ok, I'm running into brick walls.

I'm trying to do this:

from p in Products
join i in new[] {1,2,3}
on p.Id equals i
select p

I get


NotSupportedException 
Local sequence cannot be used in LINQ to SQL implementation of query operators except the Contains() operator.

I try again with this:

from p in Products
where ( new[] {1,2,3}).Contains (p.Id )
select p

Woot got some data back in LinqPad.


Tried this in actual code...

IList<int> ids = new List<int>(new[] {1, 2, 3});
IQueryable<Product> product =
from p in Products
where ids.Contains(p.Id)
select p;



I get


Method 'Boolean Contains(Int32)' has no supported translation to SQL.


But it just worked in LinqPad...

Try again:

IEnumerable<int> ids = new int[] {1, 2, 3};
IQueryable<Product> product =
from p in Products
where ids.Contains(p.Id)
select p;

Bingo.


So summary:

In LINQ, IEnumerable.Contains is only implemented for the IEnumerable interface and not the IList interface.  Seems obvious now in hindsight.

Keeping the data in the database clean

On this new project we've designed a database from the ground up.  And we've done a lot of interesting design in the system, such as implementing one-to-one tables that mirror domain object inheritance in the actual system, and referencing a number of lookup tables.

There are no real data yet, so when we need to test something, it goes into the dev database pretty much via someone running an insert script.

Inevitably, we end up with bad data, data that doesn't match the design of the database, and don't show up on views that joins multiple tables.

In this area I've come to appreciate what my old company did.  They had heaps of views designed to catch bad data.

There's always a tiny part of my soul that says... but if you designed the database with proper constraints in the first place, you'd never have bad data in the first place.

May be our database constraints are too weak, but I suspect it's because we wanted the flexibility to define our data, and some of these flexible definitions can't be protected adequately with database constraints.

jliu

SQL Metal: No exclude table/view/sp functionality?

I like SQL Metal.  Anything that can save me time to write more app is good in my book.  I do find it extremely odd that I can't exclude tables/view/sp from it's DBML generation process.

After giving it a bit of thought, I figure I'll need to do a bit of work on #2

1. sqlmetal /database /dbml:my.dbml
2. run a clean utility to strip the dbml of tables/relationships that we're not interested in.
3. sqlmetal /code my.dbml

If I get this done anytime soon, I'll put it up on codeplex.

I still think perhaps in the next version of SQL Metal we'll see exclude flags anyway.