ASP.NET Web API HTTP GET with optional parameters
Good layout and white space.

Although the logic works, I think it is very confusing, and not overly obvious.  At first glance, it the if statements are very confusing.  I would also rename the variables to have an Id or Code to the end of them to keep naming consistent.

I think this is a good place where you could incorporate the Specification Pattern.

public class StylesController : ApiController
{
    private Entities db = new Entities();

    public IEnumerable&lt;Style&gt; GetStyles(int divisionId = 0, int familyId = 0, int modelId = 0, int year = 0, string marketCode = "ANY")
    {
        var divisionIsAMatch = new DivisionIsAMatchSpecification(divisionId);
        var familyIsAMatch = new FamilyIsAMatchSpecification(familyId);
        var modelIsAMatch = new ModelIsAMatchSpecification(modelId);
        var yearIsAMatch = new YearIsAMatchSpecification(year);
        var marketIsAMatch = new MarketIsAMatchSpecification(marketCode);

        var q = db.Styles

        return q.Where(
                divisionIsAMatch
                .And(familyIsAMatch)
                .And(modelIsAMatch)
                .And(yearIsAMatch)
                .And(marketIsAMatch).IsSatisfiedBy
            ).Distinct()
           .OrderBy(s =&gt; s.Id);
    }
}


Where

internal class DivisionIsAMatchSpecification : Specification&lt;Style&gt;
{
    private readonly int _divisionId;

    public DivisionIsAMatchSpecification(int divisionId)
    {
        _divisionId = divisionId;
    }

    public bool IsSatisfiedBy(Style style)
    {
        if (_divisionId == 0) 
        {
            return true;
        }

        return style.DivisionId == _divisionId;
    }
}


Just rinse and repeat for each of the specifications you need.  Of course, you will have to create the base classes for them too.

I haven't tested this, but I have used this pattern before, and it works really nicely.