SmartDeviceProject1.SqlCeStorageHandler.TagItemMappingExists C# (CSharp) Method

TagItemMappingExists() public method

public TagItemMappingExists ( SqlCeOfflineEntity entity ) : bool
entity SqlCeOfflineEntity
return bool
        public bool TagItemMappingExists(SqlCeOfflineEntity entity)
        {
            var tagItemMapping = (TagItemMapping)entity;

            using (var command = new SqlCeCommand())
            {
                command.Connection = GetSqlCeConnection();
                command.CommandText = GET_TAGITEMMAPPING;
                command.Parameters.Add("@TagID", SqlDbType.Int).Value = tagItemMapping.TagID;
                command.Parameters.Add("@ItemID", SqlDbType.UniqueIdentifier).Value = tagItemMapping.ItemID;
                command.Parameters.Add("@UserID", SqlDbType.UniqueIdentifier).Value = tagItemMapping.UserID;

                object result = command.ExecuteScalar();

                return result != null;
            }
        }