# Tuesday, May 18, 2010

While installing Silverlight 4 Tools v1.0 for Visual Studio I ran into the following screen sometimes after the installation hanged for a while:

image

I had found that problem before while trying to install SQL Server 2008 so I located the following registry key:

image 

and removed this from the PendingFileRenameOperations

image

After doing that I ran the installation again and it completed successfully.

image

posted on Tuesday, May 18, 2010 3:32:43 PM UTC  #    Comments [0]
# Friday, May 14, 2010

Let the source code speak: (This is from a real application not "Demoware")

 

using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.ComponentModel.DataAnnotations;
using System.Linq;
using System.ServiceModel.DomainServices.Hosting;
using System.ServiceModel.DomainServices.Server;
using CBSI.GL.Application;
using CBSI.NHibernate.DomainServices;
using CBSI.GL.Domain;
using CBSI.GL.DA;
using CBSI.TAE.Dashboard.RIAServices.Web.Properties;

namespace CBSI.TAE.Dashboard.RIAServices.Web.Services
{
    [EnableClientAccess()]
    public class AccountCategoryDomainService : GLDomainService<AccountCategoryRepository, AccountCategory, long>
    {
        IAccountCategoryService _AccountCategoryService;
        public AccountCategoryDomainService(IAccountCategoryService accountCategoryService) : base(accountCategoryService.Repository)
        {
            _AccountCategoryService = accountCategoryService;
        }

        public IEnumerable<AccountCategoryModel> Categories()
        {
            return from c in this.Repository.All where (c.GLSetup.ID==this.GLSetup.ID)
                   orderby c.Name
                   select new AccountCategoryModel(c); 
        }

        public void Insert(AccountCategoryModel model)
        {
            if (this.Exists(model.Name))
                throw new ApplicationException(string.Format(Resources.AlreadyExistEntityWithName, Resources.Entity_Name_Category, model.Name));
            AccountCategory accountCategory =  new AccountCategory(this.GLSetup);
            accountCategory = model.ToDomain(accountCategory);
            SaveTransaction(accountCategory);
            this.ChangeSet.Associate(model, accountCategory, MapToModel);
        }

        public void Update(AccountCategoryModel model)
        {
            AccountCategory accountCategory = this.Repository.Get(c => c.ID == model.ID);
            if (accountCategory==null)
                throw new ApplicationException(string.Format(Resources.UpdatingNonExistingEntity, Resources.Entity_Name_Category));
            accountCategory = model.ToDomain(accountCategory);
            SaveTransaction(accountCategory);
            this.ChangeSet.Associate(model, accountCategory, MapToModel);    
        }

        public void Delete(AccountCategoryModel model)
        {
            AccountCategory accountCategory = this.Repository.Get(c => c.ID == model.ID);
            if (accountCategory == null)
                throw new ApplicationException(string.Format(Resources.DeletingNonExistingEntity, Resources.Entity_Name_Category));
            DeleteTransaction(accountCategory);
        }

        bool Exists(string name)
        {
            var ac = this.Repository.Get( c => c.Name == name);
            return (ac != null);
        }

        void MapToModel(AccountCategoryModel acm, AccountCategory ac )
        {
            acm = new AccountCategoryModel(ac);
        }
    }
}

posted on Friday, May 14, 2010 2:58:49 PM UTC  #    Comments [0]