Generating a sequence number based on last item of a list
There are a couple of things you could do differently.


number - this variable is not necessary, you can return anytime
myList - if this is already a list then you don't need to copy it
lastNumber - this is initialized too early. It should be placed inside else
if - don't ommit the {}
!items.Any() and items.Any() - you don't need to check it twice and even with different results
: "" - this value is never used because you don't enter the first else if myList.Any() - in this case you use .Number and the only place where you use the resulting lastNumber is the first else
[1] - you should name this index
intitialNumber - define this as a constant





number = myList.FirstOrDefault(p =&gt; p.Id == id).Number;



You know that this might blow? If the list is empty then the Number cannot be read. You need either C# 6 for this or one more line of code. 



Putting everything together gives:

const string intitialNumber = "Number#000001";

if (id == Guid.Empty)
{
    if(myList.Any())
    {
        const int someMagicValue = 1;
        var lastNumber = myList.Last().Number; // Last is O(1) for IList
        var nextNumber = int.Parse(lastNumber.Split('#')[someMagicValue]) + 1;
        return = $"Number#{nextNumber:D6}";
    }
    else
    {
        return intitialNumber;
    }
}
else
{
    var first = myList.FirstOrDefault(p =&gt; p.Id == id);
    return first != null ? first.Number : intitialNumber;

    // C# 6
    // myList.FirstOrDefault(p =&gt; p.Id == id)?.Number ?? intitialNumber;
}